home *** CD-ROM | disk | FTP | other *** search
/ Cinema Studio: Frank Herrmann / Cinema Studio - Frank Herrmann.iso / tools / texturestudio / rexx / blank_tsrx next >
Text File  |  1995-03-13  |  2KB  |  95 lines

  1. /* TextureStudio ARexx script **************************************/
  2.  
  3. /* Allow commands to return results */
  4.  
  5. options results
  6.  
  7. /* On error, goto ERROR:. Comment out this line if you wish to */
  8. /* perform your own error checking. */
  9.  
  10. signal on error
  11.  
  12. /* BEGIN PROGRAM *************************************************/
  13.  
  14. address "TEXTURESTUDIO"
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. /* END PROGRAM ***************************************************/
  31.  
  32. exit
  33.  
  34. /* On ERROR */
  35.  
  36. ERROR:
  37.  
  38. /* If we get here, either an error occurred with the command's */
  39. /* execution or there was an error with the command itself. */
  40. /* In the former case, rc2 contains the error message and in */
  41. /* the latter, rc2 contains an error number. SIGL contains */
  42. /* the line number of the command which caused the jump */
  43. /* to ERROR: */
  44.  
  45. if datatype(rc2,'NUMERIC') == 1 then do
  46.     /* See if we can describe the error with a string */
  47.  
  48.     select
  49.         when rc2 == 103 then
  50.             err_string = "ERROR 103, "||,
  51.                 "out of memory at line "||SIGL
  52.         when rc2 == 114 then
  53.             err_string = "ERROR 114, "||,
  54.                 "bad command template at line "||SIGL
  55.         when rc2 == 115 then
  56.             err_string = "ERROR 115, "||,
  57.                 "bad number for /N argument at line "||SIGL
  58.         when rc2 == 116 then
  59.             err_string = "ERROR 116, "||,
  60.                 "required argument missing at line "||SIGL
  61.         when rc2 == 117 then
  62.             err_string = "ERROR 117, "||,
  63.                 "value after keywork missing at line "||SIGL
  64.         when rc2 == 118 then
  65.             err_string = "ERROR 118, "||,
  66.                 "wrong number of arguments at line "||SIGL
  67.         when rc2 == 119 then
  68.             err_string = "ERROR 119, "||,
  69.                 "unmatched quotes at line "||SIGL
  70.         when rc2 == 120 then
  71.             err_string = "ERROR 120, "||,
  72.                 "line too long at line "||SIGL
  73.         when rc2 == 236 then
  74.             err_string = "ERROR 236, "||,
  75.                 "unknown command at line "||SIGL
  76.         otherwise
  77.             err_string = "ERROR "||rc2||" at line "||SIGL
  78.         end
  79.         end
  80. else if rc2 == 'RC2' then do
  81.     err_string = "ERROR in command at line "||SIGL
  82.     end
  83. else do
  84.         err_string = rc2||", line "||SIGL
  85.         end
  86.  
  87. say err_string
  88.  
  89. /* Unblock windows, just incase they are still blocked by the program being */
  90. /* terminated mid-way */
  91.  
  92. GUI_UNBLOCK
  93.  
  94. exit
  95.